package org.jeecg.modules.common.sensitive.service.impl;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.common.sensitive.entity.SensitiveRule;
import org.jeecg.modules.common.sensitive.mapper.SensitiveRuleMapper;
import org.jeecg.modules.common.sensitive.service.ISensitiveRuleService;
import org.jeecg.modules.common.sensitive.vo.DataSourceDynamic;
import org.jeecg.modules.common.sensitive.vo.response.DatabaseStatisticsResponse;
import org.jeecg.modules.common.sensitive.vo.response.LevelConfigResponse;
import org.jeecg.modules.common.sensitive.vo.response.SensitiveClassificationResponse;
import org.jeecg.modules.common.sensitive.vo.response.SensitiveStatistics;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static java.math.BigDecimal.ROUND_UNNECESSARY;

/**
 * @Description: 脱敏规则
 * @Author: jeecg-boot
 * @Date: 2022-06-14
 * @Version: V1.0
 */
@Service
public class SensitiveRuleServiceImpl extends ServiceImpl<SensitiveRuleMapper, SensitiveRule> implements ISensitiveRuleService {

    @Override
    @Cacheable(value = "sensitive_rule_single_cache", key = "#id")
    public SensitiveRule getById(Serializable id) {
        return super.getById(id);
    }

    @Override
    @Cacheable(value = "sensitive_rule_list_cache")
    public List<SensitiveRule> list() {
        return super.list();
    }

}
